#include<bits/stdc++.h>
using namespace std;

int main()
{
    string a1,a2;
    getline(cin,a1);
    getline(cin,a2);

    if(a1.compare(a2))
    cout<<a1;
    else
    cout<<a2;

    if(a1.size()==a2.size())
    cout<<1;
    else if(a1.size()>a2.size())
    cout<<a1;
    else if(a1.size()<a2.size())
    cout<<a2;

    return 0;
}